import request from '@/config/axios'

// 打赏记录 VO
export interface RewardVO {
  id: number // 编号
  userId: number // 用户编号
  workerClerkId: number // 店员编号
  workerUserId: number // 店员用户编号
  rewardType: boolean // 打赏类型：0-打赏，1-赠礼
  giftId: number // 礼物编号
  gift: string // 礼物
  count: number // 礼物数量
  payMoney: number // 礼物总金额
  fee: number // 手续费
  money: number // 实际到账
  weixin: string // 微信
  msg: string // 心动留言
  status: boolean // 状态
}

// 打赏记录 API
export const RewardApi = {
  // 查询打赏记录分页
  getRewardPage: async (params: any) => {
    return await request.get({ url: `/worker/reward/page`, params })
  },

  // 查询打赏记录详情
  getReward: async (id: number) => {
    return await request.get({ url: `/worker/reward/get?id=` + id })
  },

  // 新增打赏记录
  createReward: async (data: RewardVO) => {
    return await request.post({ url: `/worker/reward/create`, data })
  },

  // 修改打赏记录
  updateReward: async (data: RewardVO) => {
    return await request.put({ url: `/worker/reward/update`, data })
  },

  // 删除打赏记录
  deleteReward: async (id: number) => {
    return await request.delete({ url: `/worker/reward/delete?id=` + id })
  },

  // 导出打赏记录 Excel
  exportReward: async (params) => {
    return await request.download({ url: `/worker/reward/export-excel`, params })
  },
}